#!/bin/bash

#################################
#测试脚本
#################################

set -x

function check()
{
    wget https://gitee.com/spring_view/nlohmann-json/raw/openEuler-22.03-LTS-SP4/test_json.cpp
    g++ test_json.cpp -o test_json -std=c++11    
    ./test_json
    if [[ $? -eq 0 ]];then
        echo "RETURN SUCCESS"
    else
        echo "RETURN FAILED"
    fi
}

function main()
{
    ret=$(check)
    if [[ $ret == *'RETURN SUCCESS' ]];then
        echo "test scripts success"
    else
        echo "test scripts failed"
    fi
}
main
